package com.example.dayu521.gateway.service;

import cn.dev33.satoken.stp.StpInterface;
import cn.dev33.satoken.stp.StpUtil;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.List;

/**
 * 自定义权限验证接口扩展
 */
@Component
public class StpInterfaceImpl implements StpInterface {

    @Override
    public List<String> getPermissionList(Object loginId, String loginType) {

        return (List<String>) StpUtil.getSession().get("permit");
    }

    @Override
    public List<String> getRoleList(Object loginId, String loginType) {
        return (List<String>) StpUtil.getSession().get("role");
    }

}

